package com.zygh.policeasset.service;

import com.zygh.policeasset.config.FileProperties;
import com.zygh.policeasset.mapper.ImagesMapper;
import com.zygh.policeasset.pojo.Images;
import com.zygh.policeasset.uploadFile.FileException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileAttribute;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/service/ImagesService.class */
public class ImagesService {
    private final Path imagesorageLocation;
    @Autowired
    ImagesMapper imagesMapper;
    @Value("${file.uploadImages}")
    private String uploadImages;

    @Autowired
    public ImagesService(FileProperties fileProperties) {
        this.imagesorageLocation = Paths.get(fileProperties.getUploadDir(), new String[0]).toAbsolutePath().normalize();
        try {
            Files.createDirectories(this.imagesorageLocation, new FileAttribute[0]);
        } catch (Exception ex) {
            throw new FileException("Could not create the directory where the uploaded files will be stored.", ex);
        }
    }

    /*  JADX ERROR: JadxRuntimeException in pass: BlockProcessor
        jadx.core.utils.exceptions.JadxRuntimeException: Unreachable block: B:14:0x00aa
        	at jadx.core.dex.visitors.blocks.BlockProcessor.checkForUnreachableBlocks(BlockProcessor.java:86)
        	at jadx.core.dex.visitors.blocks.BlockProcessor.processBlocksTree(BlockProcessor.java:52)
        	at jadx.core.dex.visitors.blocks.BlockProcessor.visit(BlockProcessor.java:44)
        */
    public java.lang.String storeFile(com.zygh.policeasset.pojo.Images r5) {
        /*
            Method dump skipped, instructions count: 246
            To view this dump change 'Code comments level' option to 'DEBUG'
        */
        throw new UnsupportedOperationException("Method not decompiled: com.zygh.policeasset.service.ImagesService.storeFile(com.zygh.policeasset.pojo.Images):java.lang.String");
    }

    public Images findByAId(int aid, String type) {
        return this.imagesMapper.findByAId(aid, type);
    }

    public Integer add(Images params) {
        return this.imagesMapper.add(params);
    }

    public Integer update(Images params) {
        return Integer.valueOf(this.imagesMapper.update(params));
    }

    public Integer remove(int id) {
        return this.imagesMapper.remove(id);
    }
}